import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home.vue'
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err)
}
export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: () =>
        import(/* webpackChunkName: "group-foo" */ '../views/Login.vue'),
        meta: { isLogin: true, title: '登录' },
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      redirect: '/business',
      children: [
        {
          path: '/mainPage',
          component: (resolve) =>
            require(['../views/mainPage.vue'], resolve),
            meta: { isLogin: false, title: '主页' },
        },
        {
          path: '/business',
          component: (resolve) =>
            require(['../views/business/index.vue'], resolve),
            meta: { isLogin: false, title: '职位管理'},
        },
        {
          path: '/businessDetails',
          component: (resolve) =>
            require(['../views/business/businessDetails.vue'], resolve),
            meta: { isLogin: false, title: '详情' },
        },
        {
          path: '/privacytreaty',
          component: (resolve) =>
            require(['../views/BasicManagement/privacytreaty.vue'], resolve),
            meta: { isLogin: false, title: '个人隐私管理' },
        },
        {
          path: '/Exemption',
          component: (resolve) =>
            require(['../views/BasicManagement/Exemption.vue'], resolve),
            meta: { isLogin: false, title: '免责管理' },
        },
        {
          path: '/label',
          component: (resolve) =>
            require(['../views/label/label.vue'], resolve),
            meta: { isLogin: false, title: '标签库管理' },
        },
        {
          path: '/JobInformation',
          component: (resolve) =>
            require(['../views/JobInformation/JobInformation.vue'], resolve),
            meta: { isLogin: false, title: '求职信息模块' },
        },
        {
          path: '/JobInDetails',
          component: (resolve) =>
            require(['../views/JobInformation/JobInDetails.vue'], resolve),
            meta: { isLogin: false, title: '详情' },
        },
        {
          path: '/WechatAccount',
          component: (resolve) =>
            require(['../views/WechatAccount/WechatAccount.vue'], resolve),
            meta: { isLogin: false, title: '微信账号模块' },
        },
        {
          path: '/TopicPoint',
          component: (resolve) =>
            require(['../views/TopicPoint/TopicPoint.vue'], resolve),
            meta: { isLogin: false, title: '话题模块' },
        },
        {
          path: '/Entrepreneur',
          component: (resolve) =>
            require(['../views/Entrepreneur/Entrepreneur.vue'], resolve),
            meta: { isLogin: false, title: '创业者模块' },
        },
        {
          path: '/VentureFinancing',
          component: (resolve) =>
            require(['../views/VentureFinancing/VentureFinancing.vue'], resolve),
            meta: { isLogin: false, title: '创业与融资' },
        },
        {
          path: '/VentureFinancing/VentureDetail',
          component: (resolve) =>
            require(['../views/VentureFinancing/VentureDetail.vue'], resolve),
            meta: { isLogin: false, title: '创业与融资' },
        },
        {
          path: '/TopicPoint/TopicPointDetail',
          component: (resolve) =>
            require(['../views/TopicPoint/TopicPointDetail.vue'], resolve),
            meta: { isLogin: false, title: '话题模块' },
        },
        {
          path: '/Entrepreneur/EntrepreneurDetail',
          component: (resolve) =>
            require(['../views/Entrepreneur/EntrepreneurDetail.vue'], resolve),
            meta: { isLogin: false, title: '创业者模块' },
        },
        {
          path: '/investor',
          component: (resolve) =>
            require(['../views/investor/investor.vue'], resolve),
            meta: { isLogin: false, title: '投资人模块' },
        },
        {
          path: '/investor/investorDetail',
          component: (resolve) =>
            require(['../views/investor/investorDetail.vue'], resolve),
            meta: { isLogin: false, title: '投资人模块' },
        },
        {
          path: '/enterprise',
          component: (resolve) =>
            require(['../views/enterprise/enterprise.vue'], resolve),
            meta: { isLogin: false, title: '企业展示模块' },
        },
        {
          path: '/enterprise/enterpriseDetail',
          component: (resolve) =>
            require(['../views/enterprise/enterpriseDetail.vue'], resolve),
            meta: { isLogin: false, title: '企业展示模块' },
        },
        {
          path: '/offer',
          component: (resolve) =>
            require(['../views/offer/offer.vue'], resolve),
            meta: { isLogin: false, title: 'offer比较模块' },
        },
        {
          path: '/offer/offerDetail',
          component: (resolve) =>
            require(['../views/offer/offerDetail.vue'], resolve),
            meta: { isLogin: false, title: 'offer比较模块' },
        },
      ],
    },
  ],
})
